// 订单管理 - 订单

import request from '@/utils/request'
export function getList(data) {
  return request({
    url: '/resource/product/list',
    method: 'post',
    data: data,
  })
}

// 订单列表
export function postOrdersList(data) {
  return request({
    url: '/orders/list',
    method: 'post',
    data: data,
  })
}

// 订单详情
export function postOrdersInfo(data) {
  return request({
    url: '/orders/info',
    method: 'post',
    data: data,
  })
}

// 添加订单
export function postOrdersAdd(data) {
  return request({
    url: '/orders/add',
    method: 'post',
    data: data,
  })
}

// 添加订单
export function postOrdersEdit(data) {
  return request({
    url: '/orders/edit',
    method: 'post',
    data: data,
  })
}

// 确认订单
export function postOrdersConfirm(data) {
  return request({
    url: '/orders/confirm',
    method: 'post',
    data: data,
  })
}
// 确认订单
export function postOrdersRemove(data) {
  return request({
    url: '/orders/remove',
    method: 'post',
    data: data,
  })
}

// 排产
export function postOrdersScheduling(data) {
  return request({
    url: '/orders/scheduling',
    method: 'post',
    data: data,
  })
}

// 工序完成
export function postOrdersMake(data) {
  return request({
    url: '/orders/make',
    method: 'post',
    data: data,
  })
}

// 发货
export function postOrdersDelivery(data) {
  return request({
    url: '/orders/delivery',
    method: 'post',
    data: data,
  })
}

// 配送结束
export function postOrdersDeliveryFinish(data) {
  return request({
    url: '/orders/delivery/finish',
    method: 'post',
    data: data,
  })
}

// 订单完成
export function postOrdersFinish(data) {
  return request({
    url: '/orders/finish',
    method: 'post',
    data: data,
  })
}

// 订单 收款明细
export function postOrdersPayListByOrderId(data) {
  return request({
    url: '/orders/pay/list/by/order/id',
    method: 'post',
    data: data,
  })
}

// 订单 添加收款明细
export function postOrdersPayAdd(data) {
  return request({
    url: '/orders/pay/add',
    method: 'post',
    data: data,
  })
}

// 取消订单
export function postOrdersCancel(data) {
  return request({
    url: '/orders/cancel',
    method: 'post',
    data: data,
  })
}

// 扫码查询订单
export function postOrdersScanCode(data) {
  return request({
    url: '/orders/scan/code',
    method: 'post',
    data: data,
  })
}

// 扫码查询订单
export function getsslist(query) {
  return request({
    url: '/system/dict/data/type/self_orders_status',
    method: 'get',
    params: query
  })
}

export function postOrdersPaySum(data) {
  return request({
    url: '/orders/sum',
    method: 'post',
    data: data,
  })
}

export function exportOrder(data) {
	return request({
		url: '/orders/export',
		method: 'post',
		responseType: "arraybuffer",
		data: data
	})
}


//修改物流信息
export function postDditDelivery(data) {
	return request({
		url: '/orders/delivery/edit',
		method: 'post',
		data: data
	})
}

//售后提交
export function postAfter(data) {
	return request({
		url: '/orders/after/sales',
		method: 'post',
		data: data
	})
}

//排产前检测预警价格进行二次确认

export function scheduWarn(data) {
	return request({
		url: '/orders/scheduling/check/warn',
		method: 'post',
		data: data
	})
}

//批量批量排产
export function scheduList(data) {
	return request({
		url: '/orders/preview/scheduling',
		method: 'post',
		data: data
	})
}

//预览排产批次下的产品列表
export function scheduProduct(data) {
	return request({
		url: '/orders/query/batch/product',
		method: 'post',
		data: data
	})
}

//确认排产批次
export function scheduYes(data) {
	return request({
		url: '/orders/confirm/scheduling',
		method: 'post',
		data: data
	})
}

export function getzhanghList(data) {
  return request({
    url: '/pay/account/list',
    method: 'post',
    data: data,
  })
}
export function getCheckPay(data) {
  return request({
    url: '/orders/check/pay/add',
    method: 'post',
    data: data,
  })
}
export function getEcharts(data) {
  return request({
    url: '/orders/statistics/province/ratio',
    method: 'post',
    data: data,
  })
}
export function setPricePost(data) {
  return request({
    url: '/orders/update/compensate',
    method: 'post',
    data: data,
  })
}
// 地址信息提交
export function setaddress(data) {
  return request({
    url: '/orders/edit/delivery/info',
    method: 'post',
    data: data,
  })
}


